import Opt from '@/components/dt/info/Opt.js'

class Column extends Opt {
  constructor() {
    super()
    this.build()
  }

  build() {
    this.createAll()
    this.opts.push(...this.all)
  }

  createAll() {
    this.all = [
      {
        type: 'index',
        title: '序号',
        minWidth: 50
      },
      {
        field: 'orgName',
        title: '所属组织',
        minWidth: 160
      },
      {
        field: 'housesName',
        title: '案场名称',
        minWidth: 180
      },
      {
        field: 'productName',
        title: '产品',
        minWidth: 160
      },
      {
        field: 'contractDate',
        title: '签约日期',
        minWidth: 130,
        cell: {
          text: {
            type: 'date'
          }
        }
      },
      {
        field: 'roomName',
        title: '房源名称',
        minWidth: 160
      },
      {
        field: 'channelName',
        title: '渠道来源',
        minWidth: 120
      },
      {
        field: 'customerName',
        title: '客户姓名',
        minWidth: 120,
        header: {
          filter: {
            title: '客户姓名',
            key: 'customerName',
            placeholder: '请输入',
            input: {}
          }
        }
      },
      {
        field: 'area',
        title: '面积(㎡)',
        minWidth: 120,
        cell: {
          text: {
            type: 'number'
          }
        }
      },
      {
        field: 'unitPrice',
        title: '签约单价(元/M²)',
        minWidth: 140,
        cell: {
          text: {
            type: 'number'
          }
        }
      },
      {
        field: 'totalPrice',
        title: '签约总价(元)',
        minWidth: 140,
        cell: {
          text: {
            type: 'number'
          }
        }
      },
      {
        field: 'basicTotalPrice',
        title: '底总价(元)',
        minWidth: 140,
        cell: {
          text: {
            type: 'number'
          }
        }
      },
      {
        field: 'baseAgentCost',
        title: '基础代理费率',
        minWidth: 130,
        cell: {
          value: (row) => {
            return row.baseAgentCost
              ? row.baseAgentType == '1'
                ? `${row.baseAgentCost}%`
                : `${row.baseAgentCost}元`
              : ''
          },
          text: {}
        }
      },
      {
        field: 'preCommAmountSum',
        title: '预估代理费总额(含税)(元)',
        minWidth: 190,
        cell: {
          text: {
            type: 'number'
          }
        }
      },
      {
        field: 'preCommAmount',
        title: '预估代理费(不含交房)(元)',
        minWidth: 190,
        cell: {
          text: {
            type: 'number'
          }
        }
      },
      {
        field: 'prePremiumCommAmount',
        title: '预估溢价(元)',
        minWidth: 140,
        cell: {
          text: {
            type: 'number'
          }
        }
      },
      {
        field: 'preDeliveryCommAmount',
        title: '预估交房代理费(元)',
        minWidth: 150,
        cell: {
          text: {
            type: 'number'
          }
        }
      },
      {
        field: 'channelCostValue',
        title: '渠道费用(元)',
        minWidth: 140,
        cell: {
          text: {
            type: 'number'
          }
        }
      },
      {
        field: 'actualChannelCost',
        title: '实际支付渠道费用(元)',
        minWidth: 160,
        cell: {
          text: {
            type: 'number'
          }
        }
      },
      {
        field: 'accumulateMoney',
        title: '已到账房款(元)',
        minWidth: 140,
        cell: {
          text: {
            type: 'number'
          }
        }
      },
      {
        field: 'canSettlementTotalSales',
        title: '符合条件可结算总销(元)',
        minWidth: 180,
        cell: {
          text: {
            type: 'number'
          }
        }
      },
      {
        field: 'canCommAmountSum',
        title: '符合条件可结算代理费(元)',
        minWidth: 190,
        cell: {
          text: {
            type: 'number'
          }
        }
      },
      {
        field: 'canCommAmount',
        title: '符合条件可结算代理费(不含交房)(元)',
        minWidth: 260,
        cell: {
          text: {
            type: 'number'
          }
        }
      },
      {
        field: 'canPremiumCommAmount',
        title: '符合条件可结算溢价(元)',
        minWidth: 180,
        cell: {
          text: {
            type: 'number'
          }
        }
      },
      {
        field: 'canDeliveryCommAmount',
        title: '符合条件可结算交房代理费(元)',
        minWidth: 220,
        cell: {
          text: {
            type: 'number'
          }
        }
      },
      {
        field: 'settlementTotalSales',
        title: '实际结算总销(元)',
        minWidth: 140,
        cell: {
          text: {
            type: 'number'
          }
        }
      },
      {
        field: 'settledAgentCostSum',
        title: '实际结算代理费(含税)(元)',
        minWidth: 190,
        cell: {
          text: {
            type: 'number'
          }
        }
      },
      {
        field: 'settledAgentCost',
        title: '实际结算代理费(不含交房)(元)',
        minWidth: 220,
        cell: {
          text: {
            type: 'number'
          }
        }
      },
      {
        field: 'settledPremiumAgentCost',
        title: '实际结算溢价(元)',
        minWidth: 140,
        cell: {
          text: {
            type: 'number'
          }
        }
      },
      {
        field: 'settledDeliveryAgentCost',
        title: '实际结算交房代理费(元)',
        minWidth: 180,
        cell: {
          text: {
            type: 'number'
          }
        }
      },
      {
        field: 'settledAgentCostRate',
        title: '实际结算代理费率',
        minWidth: 140
      },
      {
        field: 'noConfirmAmount',
        title: '已售未确认总销(元)',
        minWidth: 150,
        cell: {
          text: {
            type: 'number'
          }
        }
      },
      {
        field: 'noConfirmAgentTax',
        title: '已售未确认代理费(含税)(元)',
        minWidth: 200,
        cell: {
          text: {
            type: 'number'
          }
        }
      },
      {
        field: 'noConfirmAgent',
        title: '已售未确认代理费(不含交房)(元)',
        minWidth: 230,
        cell: {
          text: {
            type: 'number'
          }
        }
      },
      {
        field: 'noConfirmPremiumAgent',
        title: '已售未确认溢价(元)',
        minWidth: 150,
        cell: {
          text: {
            type: 'number'
          }
        }
      },
      {
        field: 'noConfirmDeliveryAgent',
        title: '已售未确认交房代理费(元)',
        minWidth: 190,
        cell: {
          text: {
            type: 'number'
          }
        }
      },
      {
        field: 'backAmount',
        title: '回款金额(元)',
        minWidth: 140,
        cell: {
          text: {
            type: 'number'
          }
        }
      },
      {
        field: 'predictAccountDate',
        title: '全款到账日期',
        minWidth: 130,
        cell: {
          text: {
            type: 'date'
          }
        }
      },
      {
        field: 'dealRoomDate',
        title: '交房日期',
        minWidth: 130,
        cell: {
          text: {
            type: 'date'
          }
        }
      },
      {
        field: 'commissionWayStr',
        title: '结佣方式',
        minWidth: 110
      },
      {
        field: 'commCount',
        title: '已结次数',
        minWidth: 150
      },
      {
        field: 'relationSettlementName',
        title: '关联结算单',
        minWidth: 150
      },
      {
        field: 'contractorName',
        title: '签约人',
        minWidth: 120,
        header: {
          filter: {
            title: '签约人',
            key: 'contractorName',
            placeholder: '请输入',
            input: {}
          }
        }
      }
    ]
  }
}

export default Column
